package com.itheima.common;

/**
 * 基于ThreadLocal封装的工具类
 */
public class BaseContext {

    private static final ThreadLocal<Long> THREAD_LOCAL_USERID = new ThreadLocal<>();

    public static Long getId() {
        return THREAD_LOCAL_USERID.get();
    }

    public static void setCurrentId(Long currentId) {
        THREAD_LOCAL_USERID.set(currentId);
    }
}
